package model;

/**
 * SelectedBallPiece.java
 * Purpose: presents a selected ball on the game board
 * 
 * @author Hans Brems
 * @version 1.0 01/12/2011
 */

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

public class SelectedBallPiece extends Piece {
	/* Image that represents how the piece looks */
	public static BufferedImage image;
	/* Color representation of the piece */
	public static Color color = Color.YELLOW;
	
	/** Constructs a new ball piece */
	public SelectedBallPiece() {
	}
	
	/** Constructs a new ball piece */
	public SelectedBallPiece(Vector position) {
		this.position = position;
	}
	
	/** Updates the piece */
	@Override
	public void update(double delta) {
	}
	
	/** Draws the piece on the screen */
	@Override
	public void draw(Graphics2D g) {
		// Get the piece coordinates
		int x = (int)this.position.getX();
		int y = (int)this.position.getY();
		
		// Draw the piece
		if (renderImages == true && image != null) {
			g.drawImage(image, x, y, width, height, null);
		} else {
			g.setColor(SelectedBallPiece.color);
			g.fillRect(x + 10, y + 10, width - 20, height - 20);
		}
	}
}